<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>订单管理-车速递</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="../css/mymain.mymain.css">
    <script type="application/javascript" src="../js/jquery-3.3.1.js"></script>
    <script type="application/javascript" src="../js/bootstrap.min.js"></script>
    <script type="application/javascript" src="../layui/layui.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>

</head>
<body style="position: static">

<div id="app" class="bgGray">
    <div data-v-95ac8d30="" class="header3">
        <div data-v-95ac8d30="" class="layout clear">
            <div data-v-95ac8d30="" class="left logo">
                <a data-v-95ac8d30="" href="index.html">
                    <img data-v-95ac8d30="" src="">
                </a>
            </div>
            <div data-v-95ac8d30="" class="header3Nav right">|
                <a data-v-95ac8d30="" href="../pagehome/loginsuccess.html">首页</a>|
                <a data-v-95ac8d30="" href="orderManage.html">我的订单</a>|
                <a data-v-95ac8d30="" href="helpCenter.html">帮助中心</a>|
                <a data-v-95ac8d30="" href="javascript:void">退出</a>
        </div>
            <div data-v-95ac8d30="" class="header3User right">
                <i data-v-95ac8d30="" class="iconfont icon-phone"></i>
                <span data-v-95ac8d30="" class="sp1">400-919-8000</span>
                <span data-v-95ac8d30="" class="sp2">欢迎您，</span>
                <span data-v-95ac8d30="" class="sp3"></span>
            </div>
        </div>
    </div>
    <div class="userInfo">
        <div class="layout">
            <div class="userInfoCom clear">
                <div class="userInfoL left">
                    <div data-v-1cae2c34="" class="userNav">
                        <dl data-v-1cae2c34="" class="userMsg">
                            <dt data-v-1cae2c34="">
                                <img data-v-1cae2c34="" src="">
                            </dt>
                            <dd data-v-1cae2c34="">
                                <p data-v-1cae2c34=""></p>
                                <p data-v-1cae2c34="" class="p5 pp" style="">普卡会员</p>
                            </dd>
                        </dl>
                        <ul data-v-1cae2c34="" class="manNav">
                            <li data-v-1cae2c34="">
                                <a data-v-1cae2c34="" href="mymain.html" class="">订单管理</a>
                            </li>
                            <li data-v-1cae2c34="">
                                <a data-v-1cae2c34="" href="myinfo.html" class="sel">个人信息</a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="userInfoR right">

                    <div class="orderManage manage">
                        <div class="orderManageTit manageTit clear">
                            <div class="left tit">个人信息</div>
                        </div>
<div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">
                        <div class="orderList list" id="noda">
                                    <table  class="tableinfo">
                                        <tr>
                                            <td>手机号:</td>
                                            <td id="tels">{{tel}}</td>
                                        </tr>
                                        <tr>
                                            <td>邮箱:</td>
                                            <td id="emails">{{email}}</td>
                                        </tr>
                                        <tr>
                                            <td>密码:</td>
                                            <td id="passwords">{{password}}</td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                            <button data-method="offset" data-type="auto" class="layui-btn layui-btn-normal">修改</button>
                                            </td>
                                        </tr>
                                    </table>
                        </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div data-v-3aaf9db2="" class="footer2">
        <div data-v-3aaf9db2="" class="layout clear">
            <div data-v-3aaf9db2="" class="d1">
                <a data-v-3aaf9db2="" href="about.html">关于车速递</a></div></div></div>

</div>

<script type="text/javascript">
    var vm = new Vue({
        el:'#noda',
        data:{
            tel:'',
            email:'',
            password:'',
        },
    });

    $(function () {
        $.ajax({
            type:"get",
            url:"/user/checkLogin",
            dataType:"json",
            success:function(data){
                //id为0时为父类
                if(data.code==1){
                    vm.tel = data.info.tel;
                    vm.email=data.info.email;
                    vm.password=data.info.password;

                }else {
                    window.location.href=("/pagehome/login.html");
                }
            }
        });
    })

</script>

<script>
    layui.use('layer', function(){ //独立版的layer无需执行这一句
        var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句

        //触发事件
        var active = {
            setTop: function(){
                var that = this;
                //多窗口模式，层叠置顶
            }
            ,offset: function(othis){
                var type = othis.data('type')
                        ,text = othis.text();

                $.post('/user/checkLogin', {}, function(str){
                    var tel=str.info.tel;
                    var email=str.info.email;
                    var password=str.info.password;

                layer.open({
                    type: 1
                    ,offset: type //具体配置参考：http://www.layui.com/doc/modules/layer.html#offset
                    ,id: 'layerDemo'+type //防止重复弹出
                    ,content: '<div style="width: 300px; height: 200px; line-height: normal; text-align: center"><form>账号:<br><input type="text" name="tel"  id="tel"><br>邮箱:<br><input type="text" name="email" id="email"><br>密码:<br><input type="text" name="password" id="password"></form></div>'

                    ,btn: '修改'
                    ,btnAlign: 'c' //按钮居中
                    ,shade: 0 //不显示遮罩

                    ,success:function () {

                        $('#tel').val(str.info.tel)
                        $('#email').val(str.info.email)
                        $('#password').val(str.info.password)
                    }

                    ,yes: function(){

                        $.ajax({
                            url:"/user/updateInfo",
                            type:"post",
                            data:$("form").serialize(),
                            dataType:'json',
                            success:function(res) {
                                if(res.code == 1) {
                                    alert("修改成功！");
                                    window.location.href=("myinfo.html");
                                } else {
                                    layer.alert(res.info);
                                }
                            },
                            error: function() {
                                alert("修改失败");
                            }
                        });
                    }
                });
            })
            }
        };

        $('#layerDemo .layui-btn').on('click', function(){
            var othis = $(this), method = othis.data('method');
            active[method] ? active[method].call(this, othis) : '';
        });

    });
</script>


</body>
</html>
</html>